# -*- coding:UTF-8 -*-


for i in range(1,50):
    if i % 7 == 0:
        continue
    elif (i % 10 == 7):
        continue
    print(i)
